package com.ym.medical.enums;

import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.util.StdConverter;
import com.ym.common.annotations.EnumDescription;
import com.ym.common.constant.DictEnum;

/**
 * 个人消费明细交易类型
 */
@EnumDescription("个人消费明细交易类型")
public enum ConsumeDetailsTdTypeEnum implements DictEnum {

    //--------------------start-----------------

    /**
     * 图文咨询
     */
    BY_CONSULTING("01","图文咨询"),

    /**
     * 电话咨询
     */
    TELEPHONE_COUNSELING("02","电话咨询"),

    /**
     * 私人医生
     */
    PRVIVATE_DOCTOR("03","私人医生"),

    /**
     * 视频咨询
     */
    VIDEO_CONSULTATION("04","视频咨询"),

    /**
     * 送心意
     */
    TO_MIND("05","送心意"),

    /**
     * 充值
     */
    RECHARGE("98","充值"),

    /**
     * 提现
     */
    WITHDRAW("99","提现")


    //--------------------end-------------------
    ;

    private String key;

    private String value;

    ConsumeDetailsTdTypeEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }

    @Override
    public String getKey() {
        return this.key;
    }

    @Override
    public String getValue() {
        return this.value;
    }


    /**
     * 序列化使用
     */
    public static class Covert extends StdConverter<String, JSONObject> {
        @Override
        public JSONObject convert(String value) {
            return DictEnum.valueOfJson(ConsumeDetailsTdTypeEnum.class, value);
        }
    }
}
